Fix 21020:3198a2e81d38
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 11 Mar 2010 08:09:37 +0000 (08:09 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 11 Mar 2010 08:09:37 +0000 (08:09 +0000)
This has a pretty serious bug.  ioapic_to_iommu() gets returned
drhd->iommu.  However, drhd->iommu isn't allocated until part of
iommu_setup(), which is called after enable_x2apic().  Has this ever
worked?

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
xen/drivers/passthrough/vtd/intremap.c

index 0b3d95827b4c125fc21f66ac323a3fd581d43a9a..fcab930b6143f762ae66d40e590f0ade2bb0e838 100644 (file)
@@ -134,7 +134,7 @@ int iommu_supports_eim(void)
 
     /* We MUST have a DRHD unit for each IOAPIC. */
     for ( apic = 0; apic < nr_ioapics; apic++ )
-        if ( !ioapic_to_iommu(IO_APIC_ID(apic)) )
+        if ( !ioapic_to_drhd(IO_APIC_ID(apic)) )
             return 0;
 
     if ( list_empty(&acpi_drhd_units) )